package main

import "fmt"

func main() {
	var m1 map[int]string = make(map[int]string, 10)
	m1[1] = "sb"
	m1[2] = "vb"
	m1[3] = "qb"
	m1[6] = "ab"
	m1[22] = "fb"
	m1[11] = "gb"
	m1[111] = "rb"
	m1[11111] = "bb"
	m1[111111] = "nb"
	m1[11111111] = "mb"

	for v, b := range m1 {
		fmt.Printf("%v  %v\n", v, b)
	}
	fmt.Println("--------------------")

	/*

		// 删除全部可以这样
		for k, v := range m1 {
			fmt.Print(m1)
			fmt.Printf("  删除了%v   %v\n", k, v)
			delete(m1, k)
		}
		//delete(m1, 11111)
		//fmt.Println(m1)
		//fmt.Println("--------------------")
		//fmt.Println(len(m1))


	*/
	//

	//value, b := m1[1]
	//fmt.Println(value)
	//fmt.Println(b)

	m := make(map[string]map[int]string, 2)
	m["班级1"] = make(map[int]string, 3)
	m["班级1"][1] = "安安"
	m["班级1"][2] = "分分"
	m["班级1"][3] = "逛逛"

	m["班级2"] = make(map[int]string, 3)
	m["班级2"][1] = "闪闪"
	m["班级2"][2] = "噢噢"
	m["班级2"][3] = "来来"

	for k, v := range m {
		fmt.Printf("这是%v:\n", k)
		for k1, v1 := range v {
			fmt.Printf("学号:%v, 姓名:%v", k1, v1)
			fmt.Println()
		}
		fmt.Println()
	}
}
